<template>
  <!-- 个人中心/客服中心 -->
  <div id="container">
    <div class="content">
      <div class="top">
        <span></span>
        <h3>客服中心</h3>
      </div>
      <div class="helpSome">
        <div class="videoBox box" @click="goVideoTeach">
          <div class="left">
            <h3>视频帮助教程</h3>
            <p>看视频学习网站的使用</p>
          </div>
          <div class="right">
            <img src="../../../assets/img/custom1.png" alt="" />
          </div>
        </div>
        <div class="fankuiBox box" @click="goFeed">
          <div class="left">
            <h3>意见反馈</h3>
            <p>提交问题，我们会尽快跟进</p>
          </div>
          <div class="right">
            <img src="../../../assets/img/custom2.png" alt="" />
          </div>
        </div>
        <div class="phoneBox box">
          <div class="left">
            <h3>客服：{{telphone}}</h3>
            <p>{{dhkf_time}}</p>
          </div>
          <div class="right">
            <img src="../../../assets/img/custom3.png" alt="" />
          </div>
        </div>
      </div>
      <div class="customMsg">
        <!-- <div class="left">
          <div class="leftMsg boxMsg">
            <img src="../../../assets/img/custom.png" alt="" />
            <h3>在线客服</h3>
            <p>工作日周一至周五 8:30-17:30</p>
          </div>
          <button @click="goCtoline">立即联系</button>
        </div> -->
        <div class="right">
          <div class="rightMsg boxMsg">
            <img src="../../../assets/img/wechat.png" alt="" />
            <h3>客服微信</h3>
            <p>{{dhkf_time}}</p>
          </div>
          <div class="weixin">
            <img :src="kf_file_url" alt="" class="weixin" />
            <p>扫码添加客服微信</p>
          </div>
        </div>
      </div>
      <div class="top">
        <span></span>
        <h3>帮助中心</h3>
      </div>
      <div class="problem">
        <div class="problemBox" v-for="item in helpList" :key="item.id">
          <h3>{{item.title}}</h3>
          <ul>
            <li v-for="list in item.lists.slice(0,5)" :key="list.id" @click="goHelp(item.id,list.id)">{{list.title}}</li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {sysinfo,list_bzwdtype,list_bzwd} from '../../../api/http'
export default {
  name: "changeClass",
  components: {},
  data() {
    return {
      telphone:'',//客服电话
      dhkf_time:'',//工作时间
      kf_file_url:'',//客服二维码
      helpList:[],//帮助文档分类列表
    };
  },
  created(){
    //获取系统信息
     sysinfo().then((res)=>{
      console.log(res,"系统信息")
      if(res.retInt !=1){
        this.$message(res.retErr)
      }else{
        const data = res.retRes
        this.telphone = data.telphone
        this.dhkf_time = data.dhkf_time
        this.kf_file_url = data.kf_file_url
      }
    })
    //获取帮助文档分类
    list_bzwdtype({
      md5key:localStorage.getItem('md5key'),
      contenttype_id: 301
    }).then(res=>{
      console.log(res,'帮助文档分类')
      this.helpList = res.retRes
    })
  },
  methods: {
    //前往在线客服
    // goCtoline(){
    //   this.$router.push({
    //     name:"CustomOnline"
    //   })
    // },
    //前往帮助中心
    goHelp(bzwdtype_id,id) {
      this.$router.push({
        name: "HelpCenter",
        query:{
          bzwdtype_id:bzwdtype_id,
          id:id
        }
      });
    },
    //前往视频教程
    goVideoTeach() {
      this.$router.push({
        name: "VideoTeach",
      });
    },
    //前往意见反馈
    goFeed() {
      this.$router.push({
        name: "FeedBack",
      });
    },
  },
};
</script>
<style lang="less" scoped>
#container {
  .content {
    .top {
      display: flex;
      margin: 30px 0px 30px 30px;
      span {
        display: inline-block;
        position: relative;
        top: 5px;
        margin-right: 10px;
        width: 3px;
        height: 20px;
        background: #08a579;
        border-radius: 2px;
      }
      h3 {
        font-size: 20px;
      }
    }
    .helpSome {
      display: flex;
      margin-bottom: 60px;
      .box {
        display: flex;
        margin-left: 30px;
        width: 260px;
        height: 100px;
        background: #ffffff;
        border: 1px solid #dee0e3;
        cursor: pointer;
        .left {
          margin-left: 20px;
          h3 {
            margin: 20px 0 12px 0;
            font-size: 14px;
            color: #333333;
          }
          p {
            color: #646566;
            font-size: 12px;
          }
        }
        .right {
          margin: 26px auto;
          width: 48px;
          height: 48px;
          img {
            width: 48px;
            height: 48px;
            background: #f0faf7;
            border-radius: 50%;
          }
        }
      }
      .box:hover{
         box-shadow: 0px 5px 10px 0px rgba(14, 44, 12, 0.08),
          0px -2px 5px 0px rgba(14, 44, 12, 0.08);
      }
    }
    .customMsg {
      display: flex;
      margin-bottom: 70px;
      .boxMsg {
        img {
          // margin-left: 50px;
          margin-bottom: 20px;
          width: 70px;
          height: 70px;
          // border-radius: 100%;
        }
        h3 {
          margin-bottom: 10px;
          text-align: center;
          font-size: 14px;
          color: #333;
        }
        p {
          text-align: center;
          font-size: 12px;
          color: #646566;
        }
      }
      .left {
        display: flex;
        padding-right: 55px;
        margin-left: 60px;
        height: 140px;
        border-right: 1px solid #dee0e3;
        .leftMsg {
          margin-right: 50px;
        }
        button {
          margin-top: 50px;
          width: 120px;
          height: 40px;
          background: #08a579;
          border-radius: 4px;
          text-align: center;
          line-height: 40px;
          color: #fff;
          font-size: 16px;
          border: 0;
          cursor: pointer;
        }
      }
      .right {
        display: flex;
        justify-content: center;
        // margin-left: 40px;
        width: 100%;
        .rightMsg {
          display: flex;
          flex-direction: column;
          align-items: center;
          margin-right: 160px;
        }
        .weixin {
          img {
            width: 120px;
            height: 120px;
            border: 1px solid #dedede;
          }
          p {
            text-align: center;
            color: #969799;
            font-size: 12px;
          }
        }
      }
    }
    .problem {
      display: flex;
      justify-content: space-around;
      margin-bottom: 30px;
      .problemBox {
        h3 {
          margin-bottom: 10px;
          color: #333333;
          font-size: 16px;
          font-family: Microsoft YaHei;
        }
        ul {
          li {
            line-height: 34px;
            font-size: 14px;
            color: #646566;
            cursor: pointer;
          }
        }
      }
    }
  }
}
</style>
